Field of the Invention
The invention relates in general to a computer storage technology, and more particularly to a method and apparatus for writing a log subsystem of a file system, and a method and apparatus for error tracking a log subsystem of a file system.
Description of the Related Art
A file system, an essential constituent of a modern operating system, is in charge of organization and management of a disk. Further, through a universal interface, a file system also provides various file-associated operations for application programs in a convenient and efficiency manner, such as details associated with masking application programs, data storage and physical properties of the disk.
The reliability of data storage is a critical factor in evaluating the quality of a file system. A power disconnection easily results in an incomplete writing process for data that is currently being written into a file system, which may then become damaged in a next boot process due to data inconsistency. To overcome such drawback, many file systems have incorporated log subsystems. For every data writing process, data is first written into a log subsystem, and is later written from the log subsystem to an originally intended position at an appropriate time point. Thus, in the event of defective data in a log subsystem caused by a power disconnection, only the log subsystem is damaged, and the consistency of the file system is ensured although being a little dated. If a part of the data written into the file system is lost due to the power disconnection, it is ascertained that the corresponding data stored in the log subsystem is intact such that the data may be recovered from the log subsystem to the file system.
Although a log subsystem plays a critical role in ensuring the reliability of a file system, it may also be damaged as a result of malfunctions of software and hardware. The so-called damage refers to a damage that is caused by factors other than a power disconnection. In general, a power disconnection only damages a last set of data written before the power disconnection, while other data damages caused by other factors may affect any block previously written with data. Such damage may further be brought into the file system in a way that the file system may become unusable.
In a current log subsystem, a simple cyclic redundancy check (CRC) verification mechanism is provided. This mechanism calculates a CRC verification code for all data blocks of only one transaction. When a transaction contains a large number of blocks, in the occurrence of data damage, it is difficult for a subsequent analysis to learn an accurate position of the damaged data blocks.
In view of the above, there is a need for a method for log managing a file system to improve drawbacks of the known art.